package com.mayjean.core.config;

import com.mayjean.common.NezhaConstant;
import com.mayjean.common.yml.YmlResourceFactory;
import com.mayjean.core.props.NezhaProperties;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.context.annotation.PropertySource;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.Order;

/**
 * nezha application auto config
 * nezha(哪吒) start configuration
 *
 * @author kyleju
 */
@Slf4j
@Configuration
@EnableAspectJAutoProxy(proxyTargetClass = true, exposeProxy = true)
@EnableConfigurationProperties(NezhaProperties.class)
@PropertySource(
	value = {NezhaConstant.CORE_PROPERTIES_YML_FILENAME},
	factory = YmlResourceFactory.class
)
@Order(Ordered.HIGHEST_PRECEDENCE)
public class NezhaConfiguration {
}
